import request from './request'
//获取商品分类数据
export const categoryList=(model)=>request.get(`categories`,{params:model});
//删除商品分类
export const deleteCategory=(id)=>request.delete(`categories/${id}`);
//添加商品分类
export const  addCategory=(model)=>request.post('categories',model)
//修改商品分类
export const updateCategory=(model)=>request.put(`categories/${model.cat_id}`,model)
//获取分类参数列表
export const  getAttributes=(id,type)=>request.get(`categories/${id}/attributes?sel=${type}`)
//获取分类参数数据
export const getCategories=(model)=>request.get('cateGories',model)
//添加属性
export const addAttributes=(id,model)=>request.post(`categories/${id}/attributes`,model)
//修改属性
export const updateAttributes=(id,model)=>request.put(`categories/${id}/attributes/${model.attr_id}`,model)
//删除属性
export const deleteAttributes=(id,attrId)=>request.delete(`categories/${id}/attributes/${attrId}`);
//获取商品列表数据
export const getGoodList=(model)=>request.get(`goods`,{params:model})
